//
//  CANoticeFooterView.m
//  LNH
//
//  Created by twentylx on 2018/2/8.
//  Copyright © 2018年 twentylx. All rights reserved.
//

#import "CANoticeFooterView.h"

@implementation CANoticeFooterView

/**
 为视图绑定 viewModel
 
 @param viewModel 要绑定的ViewModel
 @param params 额外参数
 */
- (void)bindViewModel:(id <LMViewProtocol>)viewModel withParams:(NSDictionary *)params {
    
}

/**
 初始化额外数据
 */
- (void)lm_initializeForView {
    
}

/**
 初始化视图
 */
- (void)lm_createViewForView {
    [self setNeedsUpdateConstraints];
    
    [self addSubview:self.lineView];
    [self addSubview:self.moreButton];
}

#pragma mark layout
- (void)updateConstraints {
    [super updateConstraints];
    
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.equalTo(self);
        make.top.equalTo(self);
        make.height.mas_equalTo(5);
    }];
    
    [_moreButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lineView.mas_bottom).offset(20);
        make.centerX.equalTo(self);
    }];
}

#pragma mark get & set
- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
        _lineView.backgroundColor = RGBCOLOR(241, 241, 241);
    }
    return _lineView;
}

- (UIButton *)moreButton {
    if (!_moreButton) {
        _moreButton = [UIButton new];
        _moreButton = [UIButton new];
        [_moreButton setTitle:@"更多公告" forState:UIControlStateNormal];
        [_moreButton setTitleColor:RGBCOLOR(62, 58, 57) forState:UIControlStateNormal];
        _moreButton.titleLabel.font = [UIFont systemFontOfSize:18];
        [_moreButton setImage:[UIImage imageNamed:@"more"] forState:UIControlStateNormal];
        _moreButton.imageEdgeInsets = UIEdgeInsetsMake(0, 85, 0,0);
        _moreButton.titleEdgeInsets = UIEdgeInsetsMake(0, -45, 0, 0);
    }
    return _moreButton;
}


@end
